using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace SIMc
{
    public partial class ContactForm : Form
    {
        Contact contact;
        string group;

        public ContactForm()
        {
            InitializeComponent();
        }

        public Contact getContact() {
            return contact;
        }

        public string getGroup() {
            return group;
        }

        public void setValues(ArrayList groups, Contact contact, int index){
            TB_displayName.Text= contact.displayName;
            TB_URI.Text= contact.uri;

            CB_group.DataSource=groups;
            CB_group.SelectedIndex = index;
            this.contact = contact;
        }

        private void B_OK_Click(object sender, EventArgs e)
        {
            this.contact.displayName = TB_displayName.Text;
            this.contact.uri = TB_URI.Text;
            this.contact.group = CB_group.SelectedValue.ToString();
            this.group = CB_group.SelectedValue.ToString();
        }
    }
}